package tests;
import java.util.StringTokenizer;

import org.jfugue.IntervalNotation;
import org.jfugue.Pattern;
import org.jfugue.Player;
import org.jfugue.extras.IntervalTransformer;


public class TestTranspose {
	
	public static void main(String[] args) {
		String scaleIO = "1 0 1 0 1 1 0 1 0 1 0 1";
		StringTokenizer scaleSeq = new StringTokenizer(scaleIO, " ");
		
		String cMajScale = "C5 D5 E5 F5 G5 A5 B5 C6";
		Pattern pattern = new Pattern(cMajScale);
		
		String majScaleWithIntervals = "<1> <-3> <5> <6> <8> <10> <12> <13>";
		String minScaleWithIntervals = "<1> <3> <4> <-6> <8> <9> <11> <13>";
		
		IntervalNotation interNot = new IntervalNotation(majScaleWithIntervals);
		Pattern relativeCMajScale = interNot.getPatternForRootNote("C5");
		Pattern relativeDMajScale = interNot.getPatternForRootNote("E5");
		
		String[] tokens = relativeCMajScale.getTokens();
		for (int i = 0; i < tokens.length; i++) {
			System.out.print(tokens[i] + " ");
		}
		
		Player player = new Player();
		//player.play(pattern);
		IntervalTransformer inter = new IntervalTransformer(5);
		Pattern pattern2 = inter.transform(pattern);
		
		Pattern full = new Pattern(relativeCMajScale, relativeDMajScale);
		player.play(full);
		player.close();
	}
	
}
